Skip to content

Conversation

@christiangnrd
Copy link
Member

Finish #615. The issue was that JLArrays wasn't limiting the number of workgroup threads so it was trying to access rand state past 256.

Closes #614
Closes #615

@maleadt
Copy link
Member

maleadt commented Oct 24, 2025

Thanks for following up! Annoyingly though, test failures seem related.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 24, 2025

Your PR requires formatting changes to meet the project's style guidelines.
Please consider running Runic (git runic master) to apply these changes.

Click here to view the suggested changes.
diff --git a/test/testsuite/random.jl b/test/testsuite/random.jl
index 6ecd235..bb493da 100644
--- a/test/testsuite/random.jl
+++ b/test/testsuite/random.jl
@@ -24,7 +24,7 @@
             rand!(rng, A)
             Random.seed!(rng, 1)
             rand!(rng, B)
-            @test Array(A) == Array(B) broken=SEEDING_BROKEN && (prod(d) > length(rng.state))
+            @test Array(A) == Array(B) broken = SEEDING_BROKEN && (prod(d) > length(rng.state))
 
             if rng != cpu_rng
                 rand!(cpu_rng, A)
@@ -64,7 +64,7 @@
             randn!(rng, A)
             Random.seed!(rng, 1)
             randn!(rng, B)
-            @test Array(A) == Array(B) broken=SEEDING_BROKEN && (prod(d) > (2 * length(rng.state)))
+            @test Array(A) == Array(B) broken = SEEDING_BROKEN && (prod(d) > (2 * length(rng.state)))
 
             if rng != cpu_rng
                 randn!(cpu_rng, A)

@christiangnrd
Copy link
Member Author

The fix resurfaced #530, which wasn't detected before because we weren't testing on arrays with length greater than the maximum workgroup size. I think this should be merged once I find a way to properly mark the broken tests because that'll bring us back to where we were before the switch to KA introduced the bug.

@christiangnrd
Copy link
Member Author

Failing Metal tests are related but I'll push a fix to mark the test broken once this is merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Out-of-bounds access in randn!

3 participants